from sqlalchemy.orm import Session
import models


def get_Course_by_id(db: Session, course_id: int):
    return db.query(models.Course).filter(models.Course.course_id == course_id).first()


def get_Course_by_courseName(db: Session, name: str):
    return db.query(models.Course).filter(models.Course.course_name == name).first()


def get_Courses(db: Session, skip: int = 0, limit: int = 100):
    return db.query(models.Course).offset(skip).limit(limit).all()



# def create_Course(db: Session, course: schemas.CourseCreate):
#     fake_hashed_password = course.password + "notreallyhashed"
#     db_course = models.Course(course_name=course.course_name, hashed_password=fake_hashed_password)
#     db.add(db_course)
#     db.commit()
#     db.refresh(db_course)
#     return db_course
